const common = {
	props:{
		
	},
	data(){
		return {
			totalCount:0,
			totalScore:0,
			showQuestionList:[],
//			copySelectQuestionList:[]
		}
	},
	filters: {
		difficultyFilter: (val) => {
			let difficultyStr = '';
			if(val) {
				val = val.toLowerCase();
			}
			switch(val) {
				case 'simple':
					difficultyStr = '简单';
					break;
				case 'commonly':
					difficultyStr = '一般';
					break;
				case 'medium':
					difficultyStr = '中等';
					break;
				case 'hard':
					difficultyStr = '较难';
					break;
			}
			return difficultyStr;
		},
		modeFilter: (val) => {
			let str = '';
			if(val) {
				val = parseInt(val);
			}
			switch(val) {
				case 1:
					str = '单选';
					break;
				case 2:
					str = '多选';
					break;
				case 3:
					str = '判断';
					break;
				case 4:
					str = '填空';
					break;
				case 5:
					str = '简答';
					break;
			}
			return str;
		},
		filterIsPublic(type) {
			//1--单位  2--未单位
			let status = '';
			if(type === 1 || type === '1') {
				status = '单位'
			} else if(type === 2 || type === '2') {
				status = '未单位'
			}
			return status;
		}
	},
	created(){
		
	},
	methods:{
		//生成判断题答案
		generateTorFQuestionsAnswer(question) {
			return [{
				isRight: question.answers[0].isRight == 0 ? 0 : 1,
				answerID: '1',
				description: "【A】正确"
			}, {
				isRight: question.answers[0].isRight == 1 ? 0 : 1,
				answerID: '2',
				description: "【B】错误"
			}]
		},
		//试卷种题目和题目类型转换
		transferQuestionModeCodeToPapertype(modeCode) {
			let modeCodeString = modeCode.toString();
			if(modeCodeString === '4') {
				return '5'
			} else if(modeCodeString === '5') {
				return '6'
			} else if(modeCodeString === '6') {
				return '4'
			}
			return modeCodeString
		},
		//试卷种题目和题目类型转换
		transferPapertypeToQuestionModeCode(paperType) {
			let paperTypeString = paperType.toString();
			if(paperTypeString === '5') {
				return '4'
			} else if(paperTypeString === '6') {
				return '5'
			} else if(paperTypeString === '4') {
				return '6'
			}
			return paperTypeString
		},
	}
}
export default common